#ifndef ALL_DRIVE_H
#define ALL_DRIVE_H

#include <QTimer>
#include <QSerialPort>
#include <QSerialPortInfo>
#include <QLayout>
class all_drive:public QObject
{
public:
    all_drive();

    void startinit();

    void KbdLedScan();  //按键扫描

    void adcScan();  //adc采样

    void LEDsSetValue(char ledsvalue ,int number);//设置LED灯值

    void close_all();

    void uart4_callback();



    QString Messages;

    //int kbdfd,ledsfd,beepfd,adcfd;

private:
    char KbdStatus=0;//获取按键状态
    char led_status=0;
    char LEDSValue;//存放led要改变的值
    int Last_key_value;

    QTimer *KbdScanTimer;//按键扫描定时器
    QTimer *adcScanTimer;//按键扫描定时器
    QSerialPort *uart4;

    int rt;  //adc采样需要的变量
    unsigned long adc_vol = 0;
};

#endif // ALL_DRIVE_H
